package org.example.calc;

/**
 * @author TonySong
 * @date 2024/5/7 0007
 * @time 14:27
 */
public abstract class Operation {


    private int a;
    private int b;
    /**
     * 抽象的计算方法（子类必须重写该方法）
     * 抽象类的目的：通过抽象方法来约束子类
     * @return
     */
    public abstract int calc();

    public Operation() {
    }


    public Operation(int a, int b) {
        this.a = a;
        this.b = b;
    }

    public int getA() {
        return a;
    }

    public void setA(int a) {
        this.a = a;
    }

    public int getB() {
        return b;
    }

    public void setB(int b) {
        this.b = b;
    }
}
